import java.util.ArrayList;
import java.util.List;
import java.util.*;
abstract class Role {
    private String name;//名字

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //返回角色的攻击对敌人的伤害
    public abstract int attack();
}
public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int level1=sc.nextInt();//法师初始魔法等级
        int hurt1=sc.nextInt();//战士初始伤害值
        Team team=new Team();
        for(int i=0;i<30;i++) {   //30个role对象分成Magicer和Soldier两类
            if(i%2==0) {
                Magicer  t=new Magicer();
                t.setName("法师"+i);
                t.setLevel(level1+i);
                team.addRoles(t);
            }
            else {
                Soldier  t=new Soldier();
                t.setName("战士"+i);
                t.setHurt(hurt1+i);
                team.addRoles(t);
            }

        }
        System.out.println("所有组队成员的总伤害为:" + team.attackSum());
    }
}
/* 请在这里填写答案 Magicer、Soldier及Team类*/
class Magicer extends Role{
    private int level;

    @Override
    public int attack() {
        return level * 5;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}
class Soldier extends Role{
    private int hurt;

    @Override
    public int attack() {
        return hurt;
    }

    public int getHurt() {
        return hurt;
    }

    public void setHurt(int hurt) {
        this.hurt = hurt;
    }
}
class Team{
    List team = new ArrayList<>();
    public void addRoles(Role r){
        team.add(r);
    }
    public int attackSum(){
        int sum = 0;
        for (int i = 0; i < team.size(); i++) {
            if (team.get(i) instanceof Magicer){
                sum += ((Magicer) team.get(i)).attack();
            }else {
                sum += ((Soldier) team.get(i)).attack();
            }
        }
        return sum;
    }
}